/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Server;
import Interface.Factory;
import java.rmi.*;
import java.rmi.registry.LocateRegistry;
import java.rmi.server.*;
/**
 *
 * @author bj
 */
public class MainServer {
    public static void main(String[] args) {
        // TODO code application logic here
        try
        {
            LocateRegistry.createRegistry(1308);
            //DeThiImpl c = new DeThiImpl();
            Factory factory = new FactoryImpl();
            System.out.println("Exporting De Thi ...");
            UnicastRemoteObject.exportObject(factory,0);
            Naming.rebind("rmi://127.0.0.1:1308/Factory",factory);
            System.out.println("Register De Thi");
        }
        catch(Exception e)
        {
            System.out.println(e);
        }
    }
}
